<template>
    <table>
        <tr>
            <td>门店名称</td>
            <td>
                <input type="text" v-model="info.name"/>
            </td>
        </tr>
        <tr>
            <td>分店名称</td>
            <td>
                <input type="text" v-model="info.deName"/>
            </td>
        </tr>
        <tr>
            <td>分店地址</td>
            <td>
                <input type="text" v-model="info.aderr"/>
            </td>
        </tr>
        <tr>
            <td>门店电话</td>
            <td>
                <input type="text" v-model="info.phone"/>
            </td>
        </tr>
        <tr>
            <td>门店信息</td>
            <td>
                <input type="text" v-model="info.info"/>
            </td>
        </tr>
        <tr>
            <td>门店状态</td>
            <td>
                <input type="radio" v-model="info.state" :value="true"/>营业
                <input type="radio" v-model="info.state" :value="false"/>停业
                
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                <input type="button" value="保存" @click="add"/>
            </td>
        </tr>
    </table>
</template>

<script setup lang="ts">
import { ref,onMounted } from 'vue';
import axios from 'axios';
const info=ref({
    "id": 0,
  "name": "",
  "aderr": "",
  "deName": "",
  "phone": "",
  "info": "",
  "state": true,
})
const add=()=>{
    axios.post("https://localhost:7184/api/user/useradd",info.value).then(res=>{
        if(res.data>0){
            alert('成功');
        }
        else{
            alert('失败');
        }
    })
}
</script>

